<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'listCust.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<meta charset="utf-8">
		<title>My bootStrap</title>
		<link rel="stylesheet" href="css\bootstrap.min.css">
		<script src="js\jquery.js" > </script>
		<script src="js\bootstrap.min.js"> </script>

  </head>
  
  <body>
  <h1>问题列表</h1>
  	<hr>
  <ul class="breadcrumb" contenteditable="false">
                  <li><a href="${pageContext.request.contextPath}/addCust.jsp">增加问题</a> <span class="divider">/</span></li>
                  <li><a href="${pageContext.request.contextPath}/servlet/listCust">问题列表</a> <span class="divider">/</span></li>
                  <li class="active">帮助</li>
                </ul>
                
	<div class="col-sm-9 col-sm-offset-0">	
		<table class="table table-striped table-bordered">
			<caption>问题列表</caption>
		<thead>
					
				<tr>
				<th>问题编号</th>
				<th>问题类型</th>
				<th>问题</th>
				<th>选项A</th>
				<th>选项B</th>
				<th>选项C</th>
				<th>选项D</th>
				<th>正确答案</th>
				<th>操作问题</th>
				</tr>
		</thead>
			<tbody>
		<c:forEach items="${requestScope.list}" var="cust">
		<tr>
				<td>${cust.qid }</td>
				<td>${cust.cid== "101"?"JavaBase":(cust.cid== "102"?"HTML":
				(cust.cid== "205"?"C#DB":(cust.cid== "201"?"SQLBase":
				(cust.cid== "202"?"JavaOOP":(cust.cid== "203"?"C#OOP":(cust.cid== "204"?"JSP":""))))))}</td>
				<td>${cust.qtext}</td>
				<td>${cust.option_a}</td>
				<td>${cust.option_b}</td>
				<td>${cust.option_c}</td>
				<td>${cust.option_d}</td>
				<td>${cust.option_true}</td>
				<%-- <td>${cust.description}</td> --%>
				<td>
				<a href="${pageContext.request.contextPath}/servlet/CustInfoServlet?id=${cust.qid}">
					<button type="button" class="btn btn-primary">修改</button>
				</a>
					<a href="${pageContext.request.contextPath}/servlet/DelCustServlet?id=${cust.qid}">
					<button type="button" class="btn btn-danger">删除</button>
					</a>
				</td>
		</tr>
		</c:forEach>
			</tbody>
		</table>
	</div>
  </body>
</html>
